import instance from '@/utils/request'

export function getVideo (page, pageSize, title = '', begin = '', end = '') {
  return instance.get(`/api/video?page=${page}&pageSize=${pageSize}&videoTitle=${title}&begin=${begin}&end=${end}`)
}

export function addVideo (formData) {
  console.log(formData)
  return instance.post('/api/video', formData)
}

export function upload () {
  return instance.post('/api/upload')
}

export function changeVideo (form) {
  return instance.put('/api/video', form)
}

export function deleteVideo (idList) {
  const str = '/api/video/' + idList.map(item => item)
  return instance.delete(str)
}
